package nc.tb.report.iufoplugin;

import java.util.HashMap;

import nc.tb.report.plugin.TbCommand;
import nc.tb.report.plugin.TbReport;
import nc.tb.ufo.ui.UFOTablePane;

import com.ufsoft.report.UfoReport;
import com.ufsoft.report.sysplugin.print.PrintCmd;

public class NtbPrintCmd extends PrintCmd {
	private UfoReport m_Rep = null;
	
	public NtbPrintCmd(UfoReport rep) {
		super(rep);
		m_Rep = rep;
	}
	
	public void execute(Object[] params) {
		TbReport report = (TbReport) m_Rep;
		UFOTablePane ufoTable = TbCommand.getParentUfoTablePane(report);
		if (ufoTable != null) {
			HashMap<Integer,Integer> map = ufoTable.hideZeroVarRow();
			try {
				super.execute(params);
			}
			finally {
				ufoTable.renewHideVarRow(map);
			}
		}
		else {
			super.execute(params);
		}
	}
}
